//by Store：New Retail的item，TRAIT_STORE_NBR，RETAIL_TYPE一样，时间有重叠，则重复提示
var result = JSON.parse('{"CODE":0, "ACTION":"","LEVEL":"", "MSG":"","DATA":"","RULE":"4"}');
//var JSON_ITEM_LIST = !isNull(ITEM_LIST) ? JSON.parse(ITEM_LIST) : [];
//var EFF_DATE = new Date(NEW_RETAIL_EFF_DATE);
//var EXP_DATE = new Date(NEW_RETAIL_EXP_DATE);

function FindSameStore(ITEM_NBR,NEW_RETAIL, ID, JSON_ITEM_LIST,RETAIL_TYPE) {
  for (var i = 0; i < ITEM_LIST.length; i++) {
    if (!isNull(ITEM_LIST[i].ITEM_NBR)
      && !isNull(ITEM_LIST[i].TRAIT_STORE_NBR)
      && ITEM_LIST[i].ID != ID
      && ITEM_LIST[i].ITEM_NBR == ITEM_NBR
      && RETAIL_TYPE == JSON_ITEM_LIST[i].RETAIL_TYPE
      && ITEM_LIST[i].TRAIT_STORE_NBR == ITEM_LIST[i].TRAIT_STORE_NBR
      && isDateIntersection(EFF_DATE, EXP_DATE, new Date(JSON_ITEM_LIST[i].NEW_RETAIL_EFF_DATE), new Date(JSON_ITEM_LIST[i].NEW_RETAIL_EXP_DATE))
      //&& ITEM_LIST[i].NEW_RETAIL == NEW_RETAIL
      ) {
      return true;
    }
  }
  return false;
};

if (TRAIT_STORE_FLAG == "S" 
&& FindSameStore(ITEM_NBR,NEW_RETAIL, ID, JSON_ITEM_LIST,RETAIL_TYPE)) {
  result.CODE = 2;
  result.ACTION = "CHECKING_REPORT";
  result.MSG = "此条重复";
} 
JSON.stringify(result);